package com.dd.mapper;

import com.dd.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

@Mapper
public interface UserMapper {
    /**
     *     private String name;
     *     private String password;
     *     private Integer role_id;
     * @param user
     * @return
     */
    @Insert("insert into user(name,password,role_id) values(#{name},#{password},#{role_id})")
    public int addUser(User user);

    @Select("select * from user where name=#{name} and password=#{password}")
    User loginIf(String name, String password);
}
